<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>发现好物 - 社交精选</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #3b82f6;
            --primary-light: #60a5fa;
            --primary-dark: #2563eb;
            --secondary: #f97316;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --text-light: #94a3b8;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --border-light: #e2e8f0;
            --border-medium: #cbd5e1;
            --radius: 8px;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 55px;
            padding-bottom: 60px;
            line-height: 1.5;
        }
        
        /* 导航栏样式 */
        .navbar {
            height: 55px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            padding: 0 15px;
        }
        
        .navbar-brand {
            color: var(--primary);
            font-weight: 600;
            font-size: 1.1rem;
        }
        
        .search-bar {
            flex: 1;
            max-width: 400px;
            margin: 0 10px;
        }
        
        .search-input {
            width: 100%;
            background-color: var(--bg-light);
            border: 1px solid var(--border-light);
            border-radius: 20px;
            padding: 6px 15px;
            padding-left: 35px;
            font-size: 0.85rem;
            outline: none;
        }
        
        .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-light);
            font-size: 0.9rem;
        }
        
        .nav-actions {
            display: flex;
            gap: 15px;
            font-size: 1.1rem;
            color: var(--text-secondary);
        }
        
        /* 筛选栏 */
        .filter-bar {
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            padding: 8px 15px;
            overflow-x: auto;
            scrollbar-width: none;
        }
        
        .filter-bar::-webkit-scrollbar {
            display: none;
        }
        
        .filter-options {
            display: flex;
            gap: 15px;
            padding-bottom: 5px;
        }
        
        .filter-option {
            white-space: nowrap;
            font-size: 0.9rem;
            color: var(--text-secondary);
            padding: 5px 0;
            position: relative;
        }
        
        .filter-option.active {
            color: var(--primary);
            font-weight: 500;
        }
        
        .filter-option.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background-color: var(--primary);
            border-radius: 1px;
        }
        
        .filter-dropdown {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        /* 商品列表容器 */
        .product-container {
            padding: 10px;
        }
        
        .product-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
        
        /* 商品卡片基础样式 */
        .product-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
        }
        
        /* 商品图片容器 */
        .product-images {
            position: relative;
            aspect-ratio: 1/1;
            background-color: var(--bg-light);
            overflow: hidden;
        }
        
        /* 单图商品 */
        .single-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        
        /* 多图商品 */
        .multiple-images {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            grid-template-rows: repeat(2, 1fr);
            gap: 2px;
        }
        
        .multiple-images img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .multiple-images img:first-child {
            grid-column: 1 / 2;
            grid-row: 1 / 2;
        }
        
        .multiple-images img:nth-child(2) {
            grid-column: 2 / 3;
            grid-row: 1 / 2;
        }
        
        .multiple-images img:nth-child(3) {
            grid-column: 1 / 2;
            grid-row: 2 / 3;
        }
        
        .multiple-images img:nth-child(4) {
            grid-column: 2 / 3;
            grid-row: 2 / 3;
        }
        
        /* 无图商品 */
        .no-image {
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-light);
            font-size: 2rem;
        }
        
        /* 图片角标 */
        .image-badge {
            position: absolute;
            top: 5px;
            right: 5px;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            font-size: 0.7rem;
            padding: 2px 5px;
            border-radius: 3px;
        }
        
        .tag-badge {
            position: absolute;
            top: 5px;
            left: 5px;
            background-color: var(--secondary);
            color: white;
            font-size: 0.7rem;
            padding: 2px 5px;
            border-radius: 3px;
        }
        
        /* 商品信息 */
        .product-info {
            padding: 8px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .product-title {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-primary);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            margin-bottom: 5px;
            line-height: 1.3;
        }
        
        .product-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: auto;
        }
        
        .product-price {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--secondary);
        }
        
        .product-seller {
            display: flex;
            align-items: center;
            gap: 3px;
            font-size: 0.7rem;
            color: var(--text-light);
        }
        
        .seller-avatar {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            overflow: hidden;
        }
        
        .seller-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 商品互动区 */
        .product-actions {
            display: flex;
            justify-content: space-between;
            padding: 5px 8px 8px;
            border-top: 1px solid var(--border-light);
            font-size: 0.8rem;
        }
        
        .action-like {
            color: var(--text-light);
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        .action-like.liked {
            color: #ef4444;
        }
        
        .action-comment {
            color: var(--text-light);
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        /* 瀑布流布局切换 */
        .product-list.list-view {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .list-view .product-card {
            flex-direction: row;
        }
        
        .list-view .product-images {
            width: 100px;
            height: 100px;
            flex-shrink: 0;
        }
        
        .list-view .product-info {
            flex: 1;
            padding: 10px;
        }
        
        .list-view .product-title {
            -webkit-line-clamp: 3;
            font-size: 0.9rem;
        }
        
        .list-view .product-meta {
            margin-top: 10px;
        }
        
        .list-view .product-actions {
            border-top: none;
            padding: 0 10px 0 0;
            flex-direction: column;
            justify-content: center;
            gap: 10px;
        }
        
        /* 加载更多 */
        .load-more {
            padding: 15px;
            text-align: center;
        }
        
        .load-more-btn {
            background-color: var(--bg-white);
            border: 1px solid var(--primary);
            color: var(--primary);
            padding: 8px 25px;
            border-radius: 20px;
            font-size: 0.9rem;
            font-weight: 500;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 55px;
            background-color: var(--bg-white);
            border-top: 1px solid var(--border-light);
            display: flex;
            justify-content: space-around;
            align-items: center;
            z-index: 1000;
        }
        
        .nav-tab {
            display: flex;
            flex-direction: column;
            align-items: center;
            font-size: 0.65rem;
            color: var(--text-secondary);
            text-decoration: none;
        }
        
        .nav-tab i {
            font-size: 1rem;
            margin-bottom: 3px;
        }
        
        .nav-tab.active {
            color: var(--primary);
        }
        
        /* 筛选弹窗 */
        .filter-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            display: none;
        }
        
        .filter-modal.show {
            display: block;
        }
        
        .modal-content {
            background-color: var(--bg-white);
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            border-top-left-radius: var(--radius);
            border-top-right-radius: var(--radius);
            max-height: 80vh;
            overflow-y: auto;
        }
        
        .modal-header {
            padding: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-light);
        }
        
        .modal-title {
            font-size: 1rem;
            font-weight: 600;
        }
        
        .close-modal {
            background: none;
            border: none;
            font-size: 1.2rem;
            color: var(--text-secondary);
        }
        
        .filter-group {
            padding: 15px;
            border-bottom: 1px solid var(--border-light);
        }
        
        .filter-group-title {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 10px;
            color: var(--text-primary);
        }
        
        .filter-checkboxes {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        
        .filter-checkbox {
            display: none;
        }
        
        .filter-checkbox + label {
            display: inline-block;
            padding: 5px 12px;
            border: 1px solid var(--border-medium);
            border-radius: 15px;
            font-size: 0.85rem;
            color: var(--text-secondary);
            cursor: pointer;
        }
        
        .filter-checkbox:checked + label {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .modal-actions {
            display: flex;
            padding: 10px 15px;
            gap: 10px;
        }
        
        .reset-filters {
            flex: 1;
            padding: 8px;
            background-color: var(--bg-white);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius);
            font-size: 0.9rem;
        }
        
        .apply-filters {
            flex: 1;
            padding: 8px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-size: 0.9rem;
            font-weight: 500;
        }
        
        /* 空状态 */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 50px 20px;
            text-align: center;
            color: var(--text-light);
        }
        
        .empty-icon {
            font-size: 3rem;
            margin-bottom: 15px;
        }
        
        .empty-text {
            font-size: 0.9rem;
            margin-bottom: 20px;
        }
        
        .empty-action {
            padding: 8px 20px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-size: 0.9rem;
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <nav class="navbar fixed-top">
        <div class="container-fluid d-flex justify-content-between align-items-center">
            <span class="navbar-brand">发现好物</span>
            
            <div class="search-bar position-relative">
                <i class="fas fa-search search-icon"></i>
                <input type="text" class="search-input" placeholder="搜索商品...">
            </div>
            
            <div class="nav-actions">
                <i class="fas fa-sliders-h" id="filterToggle"></i>
                <i class="fas fa-th-list" id="viewToggle"></i>
            </div>
        </div>
    </nav>
    
    <!-- 筛选栏 -->
    <div class="filter-bar">
        <div class="filter-options">
            <div class="filter-option active">推荐</div>
            <div class="filter-option">最新上架</div>
            <div class="filter-option">销量优先</div>
            <div class="filter-option">价格从低到高</div>
            <div class="filter-option">价格从高到低</div>
            <div class="filter-option filter-dropdown">
                <span>分类</span>
                <i class="fas fa-chevron-down" style="font-size: 0.7rem;"></i>
            </div>
        </div>
    </div>
    
    <!-- 商品列表 -->
    <div class="product-container">
        <div class="product-grid product-list" id="productList">
            <!-- 1. 单图商品 -->
            <div class="product-card">
                <div class="product-images single-image">
                    <img src="https://picsum.photos/id/26/400/400" alt="商品图片">
                    <div class="tag-badge">热销</div>
                </div>
                <div class="product-info">
                    <div class="product-title">复古风陶瓷花瓶 家居装饰摆件 北欧简约风格</div>
                    <div class="product-meta">
                        <div class="product-price">¥89.00</div>
                        <div class="product-seller">
                            <div class="seller-avatar">
                                <img src="https://picsum.photos/id/64/100/100" alt="卖家头像">
                            </div>
                            <span>家居美学</span>
                        </div>
                    </div>
                </div>
                <div class="product-actions">
                    <div class="action-like">
                        <i class="far fa-heart"></i>
                        <span>128</span>
                    </div>
                    <div class="action-comment">
                        <i class="far fa-comment"></i>
                        <span>32</span>
                    </div>
                </div>
            </div>
            
            <!-- 2. 多图商品 -->
            <div class="product-card">
                <div class="product-images multiple-images">
                    <img src="https://picsum.photos/id/96/400/400" alt="商品图片1">
                    <img src="https://picsum.photos/id/20/400/400" alt="商品图片2">
                    <img src="https://picsum.photos/id/24/400/400" alt="商品图片3">
                    <img src="https://picsum.photos/id/25/400/400" alt="商品图片4">
                    <div class="image-badge">4图</div>
                </div>
                <div class="product-info">
                    <div class="product-title">纯棉印花四件套 床上用品 多种图案可选</div>
                    <div class="product-meta">
                        <div class="product-price">¥259.00</div>
                        <div class="product-seller">
                            <div class="seller-avatar">
                                <img src="https://picsum.photos/id/65/100/100" alt="卖家头像">
                            </div>
                            <span>居家优选</span>
                        </div>
                    </div>
                </div>
                <div class="product-actions">
                    <div class="action-like liked">
                        <i class="fas fa-heart"></i>
                        <span>356</span>
                    </div>
                    <div class="action-comment">
                        <i class="far fa-comment"></i>
                        <span>89</span>
                    </div>
                </div>
            </div>
            
            <!-- 3. 无图商品 -->
            <div class="product-card">
                <div class="product-images no-image">
                    <i class="fas fa-box"></i>
                </div>
                <div class="product-info">
                    <div class="product-title">定制款生日礼物 创意礼品 可刻字 免费配送</div>
                    <div class="product-meta">
                        <div class="product-price">¥129.00</div>
                        <div class="product-seller">
                            <div class="seller-avatar">
                                <img src="https://picsum.photos/id/66/100/100" alt="卖家头像">
                            </div>
                            <span>创意工坊</span>
                        </div>
                    </div>
                </div>
                <div class="product-actions">
                    <div class="action-like">
                        <i class="far fa-heart"></i>
                        <span>76</span>
                    </div>
                    <div class="action-comment">
                        <i class="far fa-comment"></i>
                        <span>15</span>
                    </div>
                </div>
            </div>
            
            <!-- 4. 单图商品 -->
            <div class="product-card">
                <div class="product-images single-image">
                    <img src="https://picsum.photos/id/42/400/400" alt="商品图片">
                    <div class="tag-badge">新品</div>
                </div>
                <div class="product-info">
                    <div class="product-title">无线蓝牙耳机 主动降噪 长续航 高清通话</div>
                    <div class="product-meta">
                        <div class="product-price">¥399.00</div>
                        <div class="product-seller">
                            <div class="seller-avatar">
                                <img src="https://picsum.photos/id/67/100/100" alt="卖家头像">
                            </div>
                            <span>数码优选</span>
                        </div>
                    </div>
                </div>
                <div class="product-actions">
                    <div class="action-like">
                        <i class="far fa-heart"></i>
                        <span>512</span>
                    </div>
                    <div class="action-comment">
                        <i class="far fa-comment"></i>
                        <span>124</span>
                    </div>
                </div>
            </div>
            
            <!-- 5. 多图商品 -->
            <div class="product-card">
                <div class="product-images multiple-images">
                    <img src="https://picsum.photos/id/49/400/400" alt="商品图片1">
                    <img src="https://picsum.photos/id/52/400/400" alt="商品图片2">
                    <img src="https://picsum.photos/id/53/400/400" alt="商品图片3">
                    <div class="image-badge">3图</div>
                </div>
                <div class="product-info">
                    <div class="product-title">手工编织藤篮 收纳筐 野餐篮 装饰篮 多尺寸</div>
                    <div class="product-meta">
                        <div class="product-price">¥69.00</div>
                        <div class="product-seller">
                            <div class="seller-avatar">
                                <img src="https://picsum.photos/id/68/100/100" alt="卖家头像">
                            </div>
                            <span>手工艺术</span>
                        </div>
                    </div>
                </div>
                <div class="product-actions">
                    <div class="action-like">
                        <i class="far fa-heart"></i>
                        <span>98</span>
                    </div>
                    <div class="action-comment">
                        <i class="far fa-comment"></i>
                        <span>23</span>
                    </div>
                </div>
            </div>
            
            <!-- 6. 无图商品 -->
            <div class="product-card">
                <div class="product-images no-image">
                    <i class="fas fa-gift"></i>
                </div>
                <div class="product-info">
                    <div class="product-title">美食礼盒 进口零食大礼包 节日礼品 企业福利</div>
                    <div class="product-meta">
                        <div class="product-price">¥159.00</div>
                        <div class="product-seller">
                            <div class="seller-avatar">
                                <img src="https://picsum.photos/id/69/100/100" alt="卖家头像">
                            </div>
                            <span>环球美食</span>
                        </div>
                    </div>
                </div>
                <div class="product-actions">
                    <div class="action-like liked">
                        <i class="fas fa-heart"></i>
                        <span>215</span>
                    </div>
                    <div class="action-comment">
                        <i class="far fa-comment"></i>
                        <span>47</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 加载更多 -->
    <div class="load-more">
        <button class="load-more-btn" id="loadMoreBtn">加载更多</button>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-tab">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-tab active">
            <i class="fas fa-shopping-bag"></i>
            <span>商品</span>
        </a>
        <a href="#" class="nav-tab">
            <i class="fas fa-plus-circle"></i>
            <span>发布</span>
        </a>
        <a href="#" class="nav-tab">
            <i class="fas fa-bell"></i>
            <span>通知</span>
        </a>
        <a href="#" class="nav-tab">
            <i class="fas fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 筛选弹窗 -->
    <div class="filter-modal" id="filterModal">
        <div class="modal-content">
            <div class="modal-header">
                <div class="modal-title">筛选条件</div>
                <button class="close-modal" id="closeModal">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            
            <div class="filter-group">
                <div class="filter-group-title">价格范围</div>
                <div class="filter-checkboxes">
                    <input type="checkbox" id="price1" class="filter-checkbox">
                    <label for="price1">0-50元</label>
                    
                    <input type="checkbox" id="price2" class="filter-checkbox">
                    <label for="price2">50-100元</label>
                    
                    <input type="checkbox" id="price3" class="filter-checkbox">
                    <label for="price3">100-300元</label>
                    
                    <input type="checkbox" id="price4" class="filter-checkbox">
                    <label for="price4">300-500元</label>
                    
                    <input type="checkbox" id="price5" class="filter-checkbox">
                    <label for="price5">500元以上</label>
                </div>
            </div>
            
            <div class="filter-group">
                <div class="filter-group-title">商品分类</div>
                <div class="filter-checkboxes">
                    <input type="checkbox" id="cat1" class="filter-checkbox">
                    <label for="cat1">家居用品</label>
                    
                    <input type="checkbox" id="cat2" class="filter-checkbox">
                    <label for="cat2">数码电子</label>
                    
                    <input type="checkbox" id="cat3" class="filter-checkbox">
                    <label for="cat3">美妆护肤</label>
                    
                    <input type="checkbox" id="cat4" class="filter-checkbox">
                    <label for="cat4">服装鞋帽</label>
                    
                    <input type="checkbox" id="cat5" class="filter-checkbox">
                    <label for="cat5">食品饮料</label>
                    
                    <input type="checkbox" id="cat6" class="filter-checkbox">
                    <label for="cat6">礼品礼物</label>
                </div>
            </div>
            
            <div class="filter-group">
                <div class="filter-group-title">其他筛选</div>
                <div class="filter-checkboxes">
                    <input type="checkbox" id="filter1" class="filter-checkbox">
                    <label for="filter1">有图片</label>
                    
                    <input type="checkbox" id="filter2" class="filter-checkbox">
                    <label for="filter2">官方认证</label>
                    
                    <input type="checkbox" id="filter3" class="filter-checkbox">
                    <label for="filter3">支持退换</label>
                    
                    <input type="checkbox" id="filter4" class="filter-checkbox">
                    <label for="filter4">今日上新</label>
                </div>
            </div>
            
            <div class="modal-actions">
                <button class="reset-filters" id="resetFilters">重置</button>
                <button class="apply-filters" id="applyFilters">确定</button>
            </div>
        </div>
    </div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 筛选弹窗控制
        const filterToggle = document.getElementById('filterToggle');
        const filterModal = document.getElementById('filterModal');
        const closeModal = document.getElementById('closeModal');
        
        filterToggle.addEventListener('click', () => {
            filterModal.classList.add('show');
        });
        
        closeModal.addEventListener('click', () => {
            filterModal.classList.remove('show');
        });
        
        // 点击弹窗外部关闭
        filterModal.addEventListener('click', (e) => {
            if (e.target === filterModal) {
                filterModal.classList.remove('show');
            }
        });
        
        // 筛选条件应用与重置
        const applyFilters = document.getElementById('applyFilters');
        const resetFilters = document.getElementById('resetFilters');
        const filterCheckboxes = document.querySelectorAll('.filter-checkbox');
        
        applyFilters.addEventListener('click', () => {
            applyFilters.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 应用中...';
            
            setTimeout(() => {
                filterModal.classList.remove('show');
                applyFilters.textContent = '确定';
                
                // 收集选中的筛选条件
                const selectedFilters = [];
                filterCheckboxes.forEach(checkbox => {
                    if (checkbox.checked) {
                        selectedFilters.push(checkbox.nextElementSibling.textContent);
                    }
                });
                
                if (selectedFilters.length > 0) {
                    console.log('应用筛选条件:', selectedFilters);
                    // 实际项目中这里会根据筛选条件更新商品列表
                }
            }, 800);
        });
        
        resetFilters.addEventListener('click', () => {
            filterCheckboxes.forEach(checkbox => {
                checkbox.checked = false;
            });
        });
        
        // 视图切换（网格/列表）
        const viewToggle = document.getElementById('viewToggle');
        const productList = document.getElementById('productList');
        let isGridView = true;
        
        viewToggle.addEventListener('click', () => {
            isGridView = !isGridView;
            
            if (isGridView) {
                productList.classList.remove('list-view');
                productList.classList.add('product-grid');
                viewToggle.classList.remove('fa-th-large');
                viewToggle.classList.add('fa-th-list');
            } else {
                productList.classList.remove('product-grid');
                productList.classList.add('list-view');
                viewToggle.classList.remove('fa-th-list');
                viewToggle.classList.add('fa-th-large');
            }
        });
        
        // 筛选选项切换
        const filterOptions = document.querySelectorAll('.filter-option');
        filterOptions.forEach(option => {
            option.addEventListener('click', () => {
                filterOptions.forEach(opt => opt.classList.remove('active'));
                option.classList.add('active');
                // 实际项目中这里会根据选择的排序方式重新排序商品
            });
        });
        
        // 商品点赞功能
        const likeButtons = document.querySelectorAll('.action-like');
        likeButtons.forEach(btn => {
            btn.addEventListener('click', () => {
                btn.classList.toggle('liked');
                const icon = btn.querySelector('i');
                const countElem = btn.querySelector('span');
                let count = parseInt(countElem.textContent);
                
                if (btn.classList.contains('liked')) {
                    icon.classList.remove('far');
                    icon.classList.add('fas');
                    count++;
                } else {
                    icon.classList.remove('fas');
                    icon.classList.add('far');
                    count--;
                }
                
                countElem.textContent = count;
            });
        });
        
        // 加载更多商品
        const loadMoreBtn = document.getElementById('loadMoreBtn');
        loadMoreBtn.addEventListener('click', () => {
            loadMoreBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 加载中...';
            
            setTimeout(() => {
                // 模拟加载更多商品
                const productGrid = document.querySelector('.product-list');
                
                // 新商品1 - 单图
                const newProduct1 = document.createElement('div');
                newProduct1.className = 'product-card';
                newProduct1.innerHTML = `
                    <div class="product-images single-image">
                        <img src="https://picsum.photos/id/60/400/400" alt="商品图片">
                    </div>
                    <div class="product-info">
                        <div class="product-title">天然植物香薰 卧室客厅可用 舒缓情绪</div>
                        <div class="product-meta">
                            <div class="product-price">¥79.00</div>
                            <div class="product-seller">
                                <div class="seller-avatar">
                                    <img src="https://picsum.photos/id/70/100/100" alt="卖家头像">
                                </div>
                                <span>生活美学</span>
                            </div>
                        </div>
                    </div>
                    <div class="product-actions">
                        <div class="action-like">
                            <i class="far fa-heart"></i>
                            <span>45</span>
                        </div>
                        <div class="action-comment">
                            <i class="far fa-comment"></i>
                            <span>8</span>
                        </div>
                    </div>
                `;
                productGrid.appendChild(newProduct1);
                
                // 新商品2 - 多图
                const newProduct2 = document.createElement('div');
                newProduct2.className = 'product-card';
                newProduct2.innerHTML = `
                    <div class="product-images multiple-images">
                        <img src="https://picsum.photos/id/62/400/400" alt="商品图片1">
                        <img src="https://picsum.photos/id/63/400/400" alt="商品图片2">
                        <div class="image-badge">2图</div>
                    </div>
                    <div class="product-info">
                        <div class="product-title">手工制作蜡烛 香薰蜡烛 礼盒装 多款可选</div>
                        <div class="product-meta">
                            <div class="product-price">¥59.00</div>
                            <div class="product-seller">
                                <div class="seller-avatar">
                                    <img src="https://picsum.photos/id/71/100/100" alt="卖家头像">
                                </div>
                                <span>手作时光</span>
                            </div>
                        </div>
                    </div>
                    <div class="product-actions">
                        <div class="action-like">
                            <i class="far fa-heart"></i>
                            <span>67</span>
                        </div>
                        <div class="action-comment">
                            <i class="far fa-comment"></i>
                            <span>12</span>
                        </div>
                    </div>
                `;
                productGrid.appendChild(newProduct2);
                
                // 为新添加的商品绑定点赞事件
                const newLikeButtons = newProduct1.querySelectorAll('.action-like, newProduct2 .action-like');
                newLikeButtons.forEach(btn => {
                    btn.addEventListener('click', () => {
                        btn.classList.toggle('liked');
                        const icon = btn.querySelector('i');
                        const countElem = btn.querySelector('span');
                        let count = parseInt(countElem.textContent);
                        
                        if (btn.classList.contains('liked')) {
                            icon.classList.remove('far');
                            icon.classList.add('fas');
                            count++;
                        } else {
                            icon.classList.remove('fas');
                            icon.classList.add('far');
                            count--;
                        }
                        
                        countElem.textContent = count;
                    });
                });
                
                loadMoreBtn.textContent = '加载更多';
            }, 1500);
        });
        
        // 底部导航切换
        const navTabs = document.querySelectorAll('.nav-tab');
        navTabs.forEach(tab => {
            tab.addEventListener('click', (e) => {
                e.preventDefault();
                navTabs.forEach(t => t.classList.remove('active'));
                tab.classList.add('active');
            });
        });
    </script>
</body>
</html>
    
